<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "feed_back".
 *
 * @property int $id
 * @property int $user_id
 * @property string $content
 * @property string $imgs
 * @property int $status
 * @property int $created_at
 */
class FeedBack extends Base
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'feed_back';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['user_id', 'status', 'created_at'], 'integer'],
            [['content'], 'required'],
            [['content', 'imgs', 'address'], 'string'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'user_id' => 'User ID',
            'content' => 'Content',
            'imgs' => 'Imgs',
            'status' => 'Status',
            'created_at' => 'Created At',
        ];
    }

    public function getUser(){
        return $this->hasOne(User::class, ['id' => 'user_id']);
    }
}
